package r21417rybchap06;

import jdk.nashorn.internal.ir.PropertyNode;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Text {
    private static Iterator Iteratorit;
    private static Map.Entry Entryen;

    public static void main(String[] args) {
        Map map = new HashMap();
        map.put("东邪", "面向对象程序设计");
        map.put("西梅", "C语言程序设计基础");
        map.put("南帝", "JSP");
        map.put("北丐", "JSP");
        map.put("老顽童", "Linux");
        map.put("郭靖", "Spring boot");
        map.put("黄蓉", "软件工程");
        map.put("Mary", "JDBC");
        map.put("郭靖", "JAVA");
        System.out.println("name   lecture");
        Iterator it = map.entrySet().iterator();
        System.out.println("输出所有老师及老师教授的课程");
        while (it.hasNext()) {
            Map.Entry en = (Map.Entry) it.next();
            System.out.println(en.getKey() + "\t" + en.getValue());
            if ("JSP".equals(en.getValue())) {
                System.out.println("输出所有教JSP的老师" + "JSP" + en.getKey());
                System.out.println("name  lecture");
                if ("面向对象程序设计".equals(en.getValue())) ;
                {
                    System.out.println("教面向对象的老师：" + en.getKey());
                }
            }

        }

    }}